﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Best.SmartCms.Service;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;

namespace Best.SmartCms.Portal.Controllers
{
    public class MallController : Controller
    {
        private readonly IMemoryCache _cache;
        private readonly ProductService _productService;

        public MallController(IMemoryCache memoryCache, ProductService productService)
        {
            _productService = productService;
            _cache = memoryCache;
        }


        public IActionResult Index()
        {
            var mallIndexModel = _productService.ProductList();
            return View(mallIndexModel);
        }

        public IActionResult Detail(long id)
        {
            var model = _productService.ProductDetail(id);
            return View(model);
        }
    }
}